<template>
    <div>
        <!-- 顶部用户信息 -->
        <div class="headerUser">
            <!-- 用户基本信息 -->
            <div class="headerUserInfo">
                <div><img src="https://pic4.zhimg.com/80/v2-0da878de3e39ba9f2f535657863987c8_720w.jpg"/></div>
                <div class="headerUsername">新浪体育</div>
                <div class="headerUsernote">討論的魅力不在於說服</div>
            </div>
            <!-- 用户关注信息 -->
            <div class="rowLayout sideMar">
                <div class="rowLayoutItem userFollowItem">
                    <span>12</span>
                    <span>关注</span>
                </div>
                <div class="rowLayoutItem userFollowItem">
                    <span>45</span>
                    <span>评论</span>
                </div>
                <div class="rowLayoutItem userFollowItem">
                    <span>1</span>
                    <span>收藏</span>
                </div>
            </div>
        </div>
        <!-- 用户收藏与评论列表 -->
        <div class="containerTab">
            <div class="contabHeader">
                <ul>
                    <li v-for="(item,index) in tabArr" :key="index" :class="currentTabIndex == index ? 'on' : null" @click="changeTab(index)">{{item}}</li>
                </ul>
            </div>
            
            <!-- 列表展示 -->
            <div class="sidePadMini">
                <div v-for="(item,index) in list" :key="index"><List @delete="deletePost" :sigleRow="sigleRow"/></div>
            </div>
            
            
        </div>


    </div>
</template>

<script>
import List from './list.vue'
export default {
    components:{
        List
    },
    data(){
        return {
            // 用户评论与收藏 tab
            tabArr:["评论","收藏"],
            currentTabIndex:0,

            list:[{},{},{}], // 列表
            sigleRow:false, // 是否为单行数据

        }
    },
    methods:{
        // 切换 tab
        changeTab(index){
            this.currentTabIndex = index
            this.sigleRow = index
        },
        // 删除列表
        deletePost(){},
    }
}
</script>

<style scoped>
    .sideMar{
        margin: 0 10vh;
    }
    .sidePadMini{
        padding: 2vh 3vh;
    }
    .rowLayout{
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }
    .rowLayoutItem{}

    /* 用户评论收藏 */
    .containerTab{ }

    .containerTab .contabHeader{
        height: 6.5vh;
        border-bottom: 1px solid #eee;
    }

    .containerTab .contabHeader ul{
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        padding: 0;
        margin: 0;
    }

    .containerTab .contabHeader ul li{
        list-style: none;
        padding: 0;
        margin: 0;
        line-height: 6.5vh;
        font-size: 2.15vh;
    }

    .containerTab .contabHeader ul .on{
        color:dodgerblue;
        font-weight: bold;
    }

    /* 用户关注区域 */
    .userFollowItem{
        margin-top: 3.2vh;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
    }
    .userFollowItem::after {
        content: "";
        width: 1px;
        height: 20px;
        display: block;
        position: absolute;
        right: 0;
        top: 30%;
        background: #66666630;
    }
    .userFollowItem:last-child::after{
        display: none;
    }

    .userFollowItem span:nth-child(1){
        font-size: 2.2vh;
        text-align:center;
    }
    .userFollowItem span:nth-child(2){
        font-size: 1.8vh;
        color: #999;
    }

    /* 用户信息 */
    .headerUser{
        display: flex;
        flex-direction: column;
        background: #efefbb; 
        background: -webkit-linear-gradient(to right, #efefbb, #d4d3dd); 
        background: linear-gradient(to right, #efefbb, #d4d3dd); 
        background-position: center;
        background-size: cover;
        padding: 8vh 0 4vh 0;
    }
    .headerUserInfo{
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .headerUserInfo div:nth-child(1){
        height: 10vh;
        width: 10vh;
        border-radius: 100%;
        overflow: hidden;
    }
    .headerUserInfo div:nth-child(1) img{
        width: 100%;
        height: 100%;
    }

    .headerUserInfo .headerUsername{
        font-size: 2.2vh;
        text-align:center;
        margin-top: 1.6vh;
    }

    .headerUserInfo .headerUsernote{
        font-size: 1.8vh;
        color: #999;
        margin-top: 1vh;
    }


</style>